<link rel="stylesheet" type="text/css" href="{$smarty.const.THEME_RELATIVE}modules/documentsmodule/css/sermonmodule.css" />

<div class="gadget">
    <div class="linklist">
        <div class="linklist_title"><h3>
                {$moduletitle}
            </h3>
        </div>
        <div class="bg_link_title">&nbsp;</div>
        {assign var="start" value=$start_pos}   
        <ul>
            {foreach name=links from=$sermons item=sermon}
            {assign var="start" value=$start+1}
            <li {if $smarty.foreach.links.first==1}style="border-top: 0px;"{/if}>
                <a href="#document_inline{$sermon->id}" title="{$_TR.download} {$sermon->name}" class="document_inline_link">{$sermon->name}</a>
            </li>
            {foreachelse}
            <li align="center"><i>{$_TR.no_link}</i></li>
            {/foreach}
        </ul>
    </div>
</div>

<script language="javascript" src="{$smarty.const.THEME_RELATIVE}modules/loginmodule/js/loginpopup.js"></script>

{* List all documents link here *}
 {foreach name=links from=$sermons item=sermon}
 <div id="document_inline{$sermon->id}" class="document_inline_div">
    {if $sermon->doc_file > 0}
    <div class="type_doc">
        <span>{$_TR.doc_type}</span>
        <a href="/download_file.php?id={$sermon->doc_file}" target=_blank><img src='{$smarty.const.THEME_RELATIVE}modules/documentsmodule/images/file_doc.jpg' border=0></a>
    </div>
    {/if}
    {if $sermon->xls_file > 0}
    <div class="type_doc">
        <span>{$_TR.xls_type}</span>
            <a href="/download_file.php?id={$sermon->xls_file}" target=_blank><img src='{$smarty.const.THEME_RELATIVE}modules/documentsmodule/images/file_xls.png' border=0></a>
    </div>
    {/if}
    {if $sermon->ppt_file > 0}
    <div class="type_doc">
        <span>{$_TR.ppt_type}</span>
        <a href="/download_file.php?id={$sermon->ppt_file}" target=_blank><img  src='{$smarty.const.THEME_RELATIVE}modules/documentsmodule/images/file_ppt.png' border=0></a>
    </div>
    {/if}
    {if $sermon->pdf_file > 0}
    <div class="type_doc">
        <span>{$_TR.pdf_type}</span>
            <a href="/download_file.php?id={$sermon->pdf_file}" target=_blank><img src='{$smarty.const.THEME_RELATIVE}modules/documentsmodule/images/file_pdf.png' border=0></a>
    </div>
    {/if}

    {if $sermon->mp3_file > 0}
    <div class="type_doc">
        <span>{$_TR.mp3_type}</span>
            <a href="/download_file.php?id={$sermon->mp3_file}" target=_blank><img  src='{$smarty.const.THEME_RELATIVE}modules/documentsmodule/images/music.jpg' border=0></a>
    </div>
    {/if}
    {if $sermon->flv_file > 0}
    <div class="type_doc">
        <span>{$_TR.flv_type}</span>
    <a href="/download_file.php?id={$sermon->flv_file}" target=_blank><img  src='{$smarty.const.THEME_RELATIVE}modules/documentsmodule/images/file_flv.jpg    ' border=0></a>
    </div>
    {/if}
 </div>
 {/foreach}

<script language="javascript">
    jQuery(document).ready(function(){ldelim}
        jQuery(".document_inline_link").fancybox({ldelim}
                'titlePosition'        : 'inside',
                'transitionIn'        : 'none',
                'transitionOut'        : 'none',
                'width': '500px',
                'height': '400px', 
                'centerOnScroll': true, 
                'autoDimensions': false,
                
        {rdelim});
    {rdelim})
</script>